Skip to content

fix: install prisma in runner stage to fix prisma generate#52

Open
davidorban wants to merge 1 commit intoviperrcrypto:mainfrom
davidorban:fix/docker-prisma-devdep
Open

fix: install prisma in runner stage to fix prisma generate#52
davidorban wants to merge 1 commit intoviperrcrypto:mainfrom
davidorban:fix/docker-prisma-devdep

Conversation

@davidorban
Copy link
Contributor

Problem

prisma and @prisma/client are listed as devDependencies in package.json. The runner stage of the Dockerfile uses npm ci --omit=dev, which correctly skips dev dependencies — but then immediately tries to run:

RUN node_modules/.bin/prisma generate

This fails with:

/bin/sh: node_modules/.bin/prisma: not found

Anyone building the Docker image from source hits this error.

Fix

Append && npm install --no-save prisma @prisma/client to the production install step so the Prisma CLI and client are available in the runner stage without being added to permanent production dependencies.

RUN npm ci --omit=dev && npm install --no-save prisma @prisma/client

Testing

Built and ran the container locally — prisma generate completes successfully and the app starts.

prisma and @prisma/client are listed as devDependencies, but the runner
stage uses `npm ci --omit=dev` which skips them. The subsequent
`RUN node_modules/.bin/prisma generate` then fails with:
  /bin/sh: node_modules/.bin/prisma: not found

Fix: append `&& npm install --no-save prisma @prisma/client` so the
binaries are available in the runner stage without adding them to
production dependencies permanently.

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant